Skip to content

[Forwardport] Prevent not category links in breadcrumbs at product page #14994#15480

Merged
magento-engcom-team merged 1 commit intomagento:2.3-developfrom
vovayatsyuk:2.3-fix-non-category-links-in-breadcrumbs
May 25, 2018
Merged

[Forwardport] Prevent not category links in breadcrumbs at product page #14994#15480
magento-engcom-team merged 1 commit intomagento:2.3-developfrom
vovayatsyuk:2.3-fix-non-category-links-in-breadcrumbs

Conversation

@vovayatsyuk
Copy link
Copy Markdown
Member

It's a cherry-pick of #14994

Description

Magento 2.2.4 only.
When a product is opened from a homepage and menu has a link to the homepage,
two home links will be inserted into breadcrumbs.

Update: Added the case with "Contacts" link in the navigation.

Manual testing scenarios

  1. Open app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml
  2. Insert the following code:
<li class="level0 level-top" role="presentation">
    <a href="<?php echo $block->getUrl() ?>" class="level-top" tabindex="-1" role="menuitem"><span>Home</span></a>
</li>
<li class="level0 level-top" role="presentation">
    <a href="<?php echo $block->getUrl('contact') ?>" class="level-top" tabindex="-1" role="menuitem"><span>Contacts</span></a>
</li>

Right before

<?= /* @escapeNotVerified */ $_menu ?>
  1. Open homepage or contacts page
  2. Click on any product to navigate to its page (It may be a product in cart)
  3. Breadcrumbs will have two "Home" links, or Contacts page will be added into breadcrumbs.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @vovayatsyuk. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants